<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('党员信息列表')"/>
</head>
<body class="gray-bg">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>学号：</label>
                                <input type="text" name="partyStudentNumber"/>
                            </li>
                            <li>
                                <label>姓名：</label>
                                <input type="text" name="partyName"/>
                            </li>
                            <li>
                                <label>班级：</label>
                                <input type="text" name="partyClass"/>
                            </li>
                            <li>
                                <label>性别：</label>
                                <select name="partySex"
                                        th:with="type=${@dict.getType('sys_user_sex')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>生日：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                       name="params[beginPartyBirthday]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                       name="params[endPartyBirthday]"/>
                            </li>
                            <li>
                                <label>籍贯：</label>
                                <input type="text" name="partyNativePlace"/>
                            </li>
                            <li>
                                <label>身份证：</label>
                                <input type="text" name="partyIdcard"/>
                            </li>
                            <li class="select-time">
                                <label>入党日期：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间"
                                       name="params[beginPartyJoinTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间"
                                       name="params[endPartyJoinTime]"/>
                            </li>
                            <li>
                                <label>入党志愿书：</label>
                                <select name="partyJoinApplication"
                                        th:with="type=${@dict.getType('sys_party_info_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>预备党员考察表：</label>
                                <select name="partyInspect"
                                        th:with="type=${@dict.getType('sys_party_info_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>转正申请书：</label>
                                <select name="partyFormalApplication"
                                        th:with="type=${@dict.getType('sys_party_info_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>思想报告：</label>
                                <select name="partyThoughtReport"
                                        th:with="type=${@dict.getType('sys_party_info_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                            th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>学生干部任职情况：</label>
                                <input type="text" name="partyStudentPost"/>
                            </li>
                            <li>
                                <label>奖惩情况：</label>
                                <input type="text" name="partyRewardsPunishments"/>
                            </li>
                            <li>
                                <label>其他：</label>
                                <input type="text" name="partyOtherInfo"/>
                            </li>
                            <li>
                                <label>班主任：</label>
                                <input type="text" name="partyHeadMaster"/>
                            </li>
                            <li>
                                <label>联系方式：</label>
                                <input type="text" name="partyConnect"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                        class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                        class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="admin:partyInfo:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
                   shiro:hasPermission="admin:partyInfo:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
                   shiro:hasPermission="admin:partyInfo:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="admin:partyInfo:import">
                    <i class="fa fa-upload"></i> 导入
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()"
                   shiro:hasPermission="admin:partyInfo:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer"/>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('admin:partyInfo:edit')}]];
        var removeFlag = [[${@permission.hasPermi('admin:partyInfo:remove')}]];
        var partySexDatas = [[${@dict.getType('sys_user_sex')}]];
        var partyJoinApplicationDatas = [[${@dict.getType('sys_party_info_status')}]];
        var partyInspectDatas = [[${@dict.getType('sys_party_info_status')}]];
        var partyFormalApplicationDatas = [[${@dict.getType('sys_party_info_status')}]];
        var partyThoughtReportDatas = [[${@dict.getType('sys_party_info_status')}]];
        var prefix = ctx + "admin/partyInfo";

        $(function () {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                importUrl: prefix + "/importData",
                importTemplateUrl: prefix + "/importTemplate",
                modalName: "党员信息",
                pagination: true,
                escape: false,
                columns: [{
                    checkbox: true
                },
                    {
                        field: 'partyId',
                        title: '党员编号',
                        visible: false
                    },
                    {
                        field: 'partyStudentNumber',
                        title: '学号'
                    },
                    {
                        field: 'partyName',
                        title: '姓名'
                    },
                    {
                        field: 'partyClass',
                        title: '班级'
                    },
                    {
                        field: 'partySex',
                        title: '性别',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(partySexDatas, value);
                        }
                    },
                    {
	                    field: 'partyBirthday',
	                    title: '生日',
	                    visible: false,
	                    formatter: function (value, row, index) {
		                    return changeDateFormat("yyyy-mm-dd", value);
	                    }
                    },
                    {
                        field: 'partyNativePlace',
                        title: '籍贯'
                    },
                    {
                        field: 'partyIdcard',
                        title: '身份证'
                    },
	                {
		                field: 'partyJoinTime',
		                title: '入党日期',
		                formatter: function (value, row, index) {
			                return changeDateFormat("yyyy-mm-dd", value);
		                }
	                },
                    {
                        field: 'partyJoinApplication',
                        title: '入党志愿书',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(partyJoinApplicationDatas, value);
                        }
                    },
                    {
                        field: 'partyInspect',
                        title: '预备党员考察表',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(partyInspectDatas, value);
                        }
                    },
                    {
                        field: 'partyFormalApplication',
                        title: '转正申请书',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(partyFormalApplicationDatas, value);
                        }
                    },
                    {
                        field: 'partyThoughtReport',
                        title: '思想报告',
                        formatter: function (value, row, index) {
                            return $.table.selectDictLabel(partyThoughtReportDatas, value);
                        }
                    },
	                {
		                field: 'partyStudentPost',
		                title: '学生干部任职情况',
		                visible: false
	                },
                    {
                        field: 'partyRewardsPunishments',
                        title: '奖惩情况'
                    },
	                {
		                field: 'partyOtherInfo',
		                title: '其他',
		                visible: false
	                },
                    {
                        field: 'partyHeadMaster',
                        title: '班主任'
                    },
                    {
                        field: 'partyConnect',
                        title: '联系方式'
                    },
                    {
                        field: 'remark',
                        title: '备注'
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function (value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.partyId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.partyId + '\')"><i class="fa fa-remove"></i>删除</a>');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });
    </script>
</body>

<!-- 导入区域 -->
<script id="importTpl" type="text/template">
    <form enctype="multipart/form-data" class="mt20 mb10">
        <div class="col-xs-offset-1">
            <input type="file" id="file" name="file"/>
            <div class="mt10 pt5">
                <input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在，更新这条数据。"> 是否更新已经存在的用户数据
                &nbsp; <a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i
                    class="fa fa-file-excel-o"></i> 下载模板</a>
            </div>
            <font color="red" class="pull-left mt10">
                提示：仅允许导入“xls”或“xlsx”格式文件！
            </font>
        </div>
    </form>
</script>
</html>